package com.itheima.App;


import com.itheima.SpringConfig.StringConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;

public class appdatasource {
    public static void main(String[] args) throws SQLException {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(StringConfig.class);
        DataSource bean = ctx.getBean(DataSource.class);
        System.out.println(bean.getConnection().isClosed());
        ctx.close();

    }
}
